//
//  LYCHomeViewModel.swift
//  新浪微博
//
//  Created by liuyanchi on 16/8/1.
//  Copyright © 2016年 liuyanchi. All rights reserved.
//

import UIKit

class LYCHomeViewModel: NSObject {

    func loadData(success:()->(),failed:()->()){
    
        // 1.
        let url =  "https://api.weibo.com/2/statuses/home_timeline.json"
        
        guard let token = LYCLoginViewModel.shareInstance.access_token else{
            
            return
            
        }
        
        let prams = ["access_token": token]
        
        LYCHTTPClient.shareInstance.request(.GET, URLString: url, parameters: prams, progress: nil, success: { (_, JSON) -> Void in
            
            success()
            
            }) { (_, error) -> Void in
                
             failed()
        }
        
    }
    
}


